package com.patternsbox.behavioral.iterator;

public class ConcreteIterator implements Iterator {

    private Aggregate aggregate;

    private int current = 0;
    
	public ConcreteIterator(Aggregate concreteAggregate) {
		this.aggregate = concreteAggregate;
	}

	public Object currentItem() {
		return aggregate.get(current);
	}

	public Object first() {
		current=0;
		return aggregate.get(current);
	}

	public boolean isDone() {
		return (current>=aggregate.count());
	}

	public Object next() {
		current++;
		return aggregate.get(current);
	}

}
